<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>中国福利彩票</title>
<link href="css/style.css" type="text/css" rel="stylesheet" />
	<link rel="icon" href="images/favicon.png" type="image/x-icon"/>
<script src="js/jquery-1.7.2.min.js"></script>

</head>

<body>
	<div class="Header">
    	<div class="width1200">
        	<div class="left H_logo"><a href="MemberCenter.html"><img src="images/logo.png" width="200" /></a></div>
            <div class="right H_right">欢迎  <a href="MemberCenter.html"><span id="userName"></span></a> <a href="Login.html">注销！</a></div>
            <div class="clear"></div>
        </div>
    </div>
	
    <div class="width1200">
    	<div class="I_main">
            <div class="left IM_left">
            	<div class="IM_T1">查询服务</div>
                <div class="IML_two">
                	<ul>
						<li><a href="Xzhtz.html" style="border:none;"><img src="images/Limg1.png" width="16" />交易记录查询</a></li>
						<li><a href="Xzjls.html"><img src="images/Limg1.png" width="16" />资金记录查询</a></li>
                    </ul>
                </div>
                <div class="IM_T2">个人设置</div>
                <div class="IML_two">
                	<ul>
                    	<li><a href="BankCard.html"><img src="images/Limg2.png" width="16" />银行卡变更</a></li>
                        <li><a href="PhoneNumber.html"><img src="images/Limg3.png" width="16" />手机号变更</a></li>
                        <li><a href="Yuecx.html"><img src="images/Limg4.png" width="16" />余额查询</a></li>
                        <li><a href="PassWord.html"><img src="images/Limg5.png" width="16" />修改密码</a></li>
                        <li><a href="App.html"><img src="images/Limg6.png" width="16" />APP下载</a></li>
                    </ul>
                </div>
            </div>
            <div class="right IM_right">
            	
                <div class="IMR_title">
                	<img src="images/RTb.jpg" width="5" />个人资料
                </div>
                
                <div class="IM_Rbig">
                	<div class="IM_hyzx">
                    	<ul>
                        	<li><span class="color9">姓名：<span id="name"></span></li>
                            <li><span class="color9">性别：<span id="sex"></span></li>
                            <li><span class="color9">投注账户编号：<span class="e50014 f16 bold" id="accountId"></li>
                            <li><span class="color9">邮箱：<a href="#" class="f16 bold"><span id="email"></span></a></li>
                            <li><span class="color9">职业:<span id="job"></span></li>
                            <li><span class="color9">月收入：<span class="f16 bold" id="monthInCome"></span></li>
                            <!--<li><span class="color9">资金余额：<span class="e50014" id="balance"></span></li>-->
                            <li><span class="color9">地址：<span id="address"></span></li>
                        </ul>
                    </div>
                </div>
                
            </div>
            <div class="clear"></div>
    	</div>
    </div>
    
    <div class="Footer">
    	<div class="width1200">
        	<div class="left">版权所有：中国福利彩票发行管理中心    网站主办：中国福利彩票发行管理中心</div>
            <div class="right"><img src="images/Flogo.png" width="110" /></div>
            <div class="clear"></div>
        </div>
    </div>
</body>
<script type="text/javascript">
var accountId = "";
var provinceName="";//地址：省级中文名
var cityName="";//地址：城市中文名
var balance="";//余额
$(document).ready(function() {
	$('#userName').html(getCookie("username"));
	accountId = getCookie("accountId");
	getPersonInfo();
});
//查询个人注册信息
function getPersonInfo(){
	  var para = {
	        };
		
		$.ajax({
			url : "../../api/CrmSystem/account/info?accountId="+accountId+"",
			async:false,
			type : "GET",
			herder:{
				'Accept':'application/json',
				'Content-Type':'application/json'
			},
			dataType:"json",
			contentType:"application/json",
			data: JSON.stringify(para),
			error:function(XMLHttpRequest, textStatus, errorThrown){
				alert(errorThrown);
			},
			success: function(data, textStatus){
// 				var obj = eval("("+data+")"); 
				if(data.success == true){
					$('#name').html(data.name);//姓名赋值
					//性别赋值
					if(data.sex=='1'){
						$('#sex').html("男");
					}else{
						$('#sex').html("女");
					}
					$('#accountId').html(data.accountId);//投注账户编号赋值
					$('#email').html(data.email);//邮箱赋值
					//职业赋值
					if(data.job=='1'){
						$('#job').html("专业技术人员（律师，工程师等）");
					}else if(data.job=='2'){
						$('#job').html("政府公务员或事业单位编制人员");
					}else if(data.job=='3'){
						$('#job').html("个体户/私营老板");
					}else if(data.job=='4'){
						$('#job').html("企业中高层管理人员");
					}else if(data.job=='5'){
						$('#job').html("企业办公室职员");
					}else if(data.job=='6'){
						$('#job').html("工人，服务人员等");
					}
// 					else if(data.job=='7'){
// 						$('#job').html("自由职业者");
// 					}else if(data.job=='8'){
// 						$('#job').html("其他");
// 					}
					//月收入赋值
					if(data.monthincome=='1'){
						$('#monthInCome').html("1000元以下");
					}else if(data.monthincome=='2'){
						$('#monthInCome').html("1000-3000元");
					}else if(data.monthincome=='3'){
						$('#monthInCome').html("3000-5000元");
					}else if(data.monthincome=='4'){
						$('#monthInCome').html("5000-10000元");
					}else if(data.monthincome=='5'){
						$('#monthInCome').html("10000-20000元");
					}else if(data.monthincome=='6'){
						$('#monthInCome').html("20000元以上");
					}
					//地址赋值
					//getPlaceName(0,data.address.split("_")[0]);
					//getPlaceName(data.address.split("_")[0],data.address.split("_")[1]);
					$('#address').html(provinceName+cityName+data.address.split("_")[0]);
					
//					getBalance();
//					$('#balance').html(balance);
				}else{
					alert("error:"+data.description);
					return;
				}
			}		
		});
  }
  
  
//根据归属地编号获得对应的中文名
function getPlaceName(fatherCode,code){
	$.ajax({
		url : "../../api/CrmSystem/para/region?pid="+fatherCode,
		async:false,
		type : "GET",
		herder:{
			'Accept':'application/json',
			'Content-Type':'application/json'
		},
		dataType:"json",
		contentType:"application/json",
		error:function(XMLHttpRequest, textStatus, errorThrown){
			alert(errorThrown);
		},
		success: function(data, textStatus){
			for(var i=0;i<data.length;i++){
				if(data[i].id == code){
					if(fatherCode==0){
						provinceName=data[i].regionName;
					}else{
						cityName=data[i].regionName;
					}
				}
			}
		}		
	});
}

function getBalance(){
	 var para = {
	        };
	$.ajax({
		url : "../../api/CrmSystem/funds/accountwagermoney?accountId="+accountId+"",
		async:false,
		type : "GET",
		herder:{
			'Accept':'application/json',
			'Content-Type':'application/json'
		},
		dataType:"json",
		contentType:"application/json",
		data:JSON.stringify(para),
		error:function(XMLHttpRequest, textStatus, errorThrown){
			alert(errorThrown);
		},
		success: function(data, textStatus){
			if(data.success==true){
				balance = data.balance+"元";
			}else{
				alert("error:"+data.description);
				return;
			}
		}		
	});
}
</script>
<script src="js/jsCallCookies.js"></script>
</html>
